import React, {Component} from 'react'
import { Carousel } from 'antd-mobile';
class Swiper extends Component {
    constructor(props) {
        super(props)
        this.state = {}
    }
    render() {
        return (
            <div>
                <Carousel
                    autoplay={true}
                    infinite
                    selectedIndex={2}
                >
                    {
                        this.props.carouselList.map((val, index) => (
                            <a
                                key={index}
                            >
                                <img
                                    src={val.picUrl}
                                    alt=""
                                    style={{ width: '100%', verticalAlign: 'top' }}
                                    onLoad={() => {
                                        window.dispatchEvent(new Event('resize'));
                                    }}
                                />
                            </a>
                        ))
                    }
                </Carousel>
            </div>
        )
    }
}

export default Swiper